<?php

namespace app\mini\model;

/**
 * @property int id
 * @property int order_id
 * @property int store_id
 * @property int $store_user_id 会员ID
 * @property int $salesman_id
 * @property int $company_id
 * @property string $no
 * @property int $pay_type
 * @property int $goods_cate_id
 */
class StoreOrder extends Base
{
    const NOT_SEND_GOODS = 1; // 非赠品
    const SEND_GOODS = 2; // 赠品
    
    public static function onBeforeInsert(StoreOrder $model)
    {
        $model->company_id = getCompanyId('mini');
        $model->no         = "XS".date('YmdHis') . mt_rand(100000, 999999);
    }

}